package com.itfreer.gis.map.resource.entity;

import java.io.Serializable;
import java.util.LinkedHashSet;
import java.util.Set;

import com.itfreer.form.api.entity.EntityBase;
import com.itfreer.form.api.reflect.DictionaryField;
import com.itfreer.utils.file.FileMeta;

import javax.persistence.*;

/**
 * 定义我的服务实体
 */
@Entity(name = "gis_custom_service")
public class CustomServiceEntity extends EntityBase implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@Id
	@Column(name = "id", length = 50, nullable = true)
	private String id;

	/**
	 * 名称
	 */
	@Column(name = "s_name", length = 50, nullable = true)
	private String name;

	/**
	 * 原始服务地址
	 */
	@Column(name = "s_original", length = 255, nullable = true)
	private String original;

	/**
	 * 服务状态
	 */
	@Column(name = "s_state", length = 10, nullable = true)
	@DictionaryField(dictionaryName = "d_service_status", toFieldName = "stateName")
	private String state;

	@Transient
	private String stateName;

	/**
	 * 数据源中文名称
	 */
	@Column(name = "s_cname", length = 50, nullable = true)
	private String cname;

	/**
	 * 数据源类型
	 */
	@Column(name = "s_type", length = 50, nullable = true)
	@DictionaryField(dictionaryName = "d_data_source_type", toFieldName = "typeName")
	private String type;

	@Transient
	private String typeName;

	/**
	 * 数据源服务器类型
	 */
	@Column(name = "s_server_type", length = 50, nullable = true)
	@DictionaryField(dictionaryName = "d_souce_server_type", toFieldName = "serverTypeName")
	private String serverType;

	@Transient
	private String serverTypeName;

	/**
	 * 源数据id
	 */
	@Column(name = "s_metedata", length = 50, nullable = true)
	@DictionaryField(dictionaryName = "g_data_definition", toFieldName = "metedataName")
	private String metedata;

	@Transient
	private String metedataName;

	/**
	 * 服务权限
	 */
	@Column(name = "s_permission", length = 10, nullable = true)
	@DictionaryField(dictionaryName = "d_service_permission", toFieldName = "permissionName")
	private String permission;

	@Transient
	private String permissionName;

	/**
	 * 坐标系统
	 */
	@Column(name = "s_src", length = 50, nullable = true)
	@DictionaryField(dictionaryName = "d_coordinate_system", toFieldName = "srcName")
	private String src;

	@Transient
	private String srcName;

	/**
	 * 覆盖范围
	 */
	@Column(name = "s_range", length = 50, nullable = true)
	private String range;

	/**
	 * 年份
	 */
	@Column(name = "s_year", length = 10, nullable = true)
	private String year;

	/**
	 * 服务缩略图
	 */
	@Column(name = "s_thumbnail", columnDefinition = "text", nullable = true)
	private String thumbnail;

	/**
	 * 服务代理地址
	 */
	@Column(name = "s_proxy", length = 255, nullable = true)
	private String proxy;

	/**
	 * 是否启用
	 */
	@Column(name = "s_enable", nullable = true)
	private Boolean enable;
	/**
	 * 审批状态
	 */
	@Column(name = "s_approval", length = 50, nullable = true)
	private String approval;

	/**
	 * 资源目录
	 */
	@Column(name = "s_content", length = 50, nullable = true)
	private String content;

	/**
	 * 注册人Id
	 */
	@Column(name = "s_registrantid", length = 50, nullable = true)
	private String registrantid;

	/**
	 * 注册人名字
	 */
	@Column(name = "s_registrantname", length = 50, nullable = true)
	private String registrantname;

	/**
	 * 注册时间
	 */
	@Column(name = "s_registertime", nullable = true)
	private java.util.Date registertime;

	/**
	 * 排序
	 */
	@Column(name = "s_order", nullable = true)
	private Integer order;

	/**
	 * 说明
	 */
	@Column(name = "s_info", columnDefinition = "text", nullable = true)
	private String info;

	/**
	 * 租户ID
	 */
	@Column(name = "s_tenantid", length = 50, nullable = true)
	private String tenantID;

	/**
	 * 租户名称
	 */
	@Column(name = "s_tenantname", length = 50, nullable = true)
	private String tenantName;

	/**
	 * 自研服务方案
	 */
	@SuppressWarnings("deprecation")
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
	@org.hibernate.annotations.ForeignKey(name = "none")
	@JoinColumn(name = "p_id")
	@OrderBy("i_order ASC")
	private Set<ServiceSchemeEntity> serviceSchemes = new LinkedHashSet<>();

	/**
	 * 当前进度
	 */
	@Column(name = "i_curSchedule", length = 50, nullable = true)
	private Integer curSchedule;

	/**
	 * 总进度
	 */
	@Column(name = "i_allSchedule", length = 50, nullable = true)
	private Integer allSchedule;

	/**
	 * 当前级别
	 */
	@Column(name = "i_curLevel", length = 50, nullable = true)
	private Integer curLevel;

	/**
	 * 总进度
	 */
	@Column(name = "s_spend", length = 50, nullable = true)
	private String spend;

	/**
	 * 共享租户ID
	 */
	@Column(name = "s_shareTenantID", nullable = true, columnDefinition = "text")
	private String shareTenantID;

	/**
	 * 共享租户名称
	 */
	@Column(name = "s_shareTenantName", nullable = true, columnDefinition = "text")
	private String shareTenantName;

	/**
	 *
	 */
	public String getId() {
		return id;
	}

	/**
	 *
	 */
	public void setId(String value) {
		this.id = value;
	}

	/**
	 *
	 */
	public String getName() {
		return name;
	}

	/**
	 *
	 */
	public void setName(String value) {
		this.name = value;
	}

	/**
	 *
	 */
	public String getOriginal() {
		return original;
	}

	/**
	 *
	 */
	public void setOriginal(String value) {
		this.original = value;
	}

	/**
	 *
	 */
	public String getState() {
		return state;
	}

	/**
	 *
	 */
	public void setState(String value) {
		this.state = value;
	}

	/**
	 *
	 */
	public String getPermission() {
		return permission;
	}

	/**
	 *
	 */
	public void setPermission(String value) {
		this.permission = value;
	}

	@Transient
	public String getMetedataName() {
		return metedataName;
	}

	public void setMetedataName(String metedataName) {
		this.metedataName = metedataName;
	}

	/**
	 *
	 */
	public String getSrc() {
		return src;
	}

	/**
	 *
	 */
	public void setSrc(String value) {
		this.src = value;
	}

	/**
	 *
	 */
	public String getRange() {
		return range;
	}

	/**
	 *
	 */
	public void setRange(String value) {
		this.range = value;
	}

	/**
	 *
	 */
	public String getYear() {
		return year;
	}

	/**
	 *
	 */
	public void setYear(String value) {
		this.year = value;
	}

	/**
	 *
	 */
	public FileMeta[] getThumbnail() {
		return super.getFileArray(this.thumbnail);
	}

	/**
	 *
	 */
	public void setThumbnail(FileMeta[] value) {
		this.thumbnail = super.getFileString(value);
	}

	/**
	 *
	 */
	public String getProxy() {
		return proxy;
	}

	/**
	 *
	 */
	public void setProxy(String value) {
		this.proxy = value;
	}

	/**
	 *
	 */
	public Boolean getEnable() {
		return enable;
	}

	/**
	 *
	 */
	public void setEnable(Boolean value) {
		this.enable = value;
	}

	/**
	 *
	 */
	public String getApproval() {
		return approval;
	}

	/**
	 *
	 */
	public void setApproval(String value) {
		this.approval = value;
	}

	/**
	 *
	 */
	public String getContent() {
		return content;
	}

	/**
	 *
	 */
	public void setContent(String value) {
		this.content = value;
	}

	/**
	 *
	 */
	public String getRegistrantid() {
		return registrantid;
	}

	/**
	 *
	 */
	public void setRegistrantid(String value) {
		this.registrantid = value;
	}

	/**
	 *
	 */
	public String getRegistrantname() {
		return registrantname;
	}

	/**
	 *
	 */
	public void setRegistrantname(String value) {
		this.registrantname = value;
	}

	/**
	 *
	 */
	public java.util.Date getRegistertime() {
		return registertime;
	}

	/**
	 *
	 */
	public void setRegistertime(java.util.Date value) {
		this.registertime = value;
	}

	/**
	 *
	 */
	public Integer getOrder() {
		return order;
	}

	/**
	 *
	 */
	public void setOrder(Integer value) {
		this.order = value;
	}

	/**
	 *
	 */
	public String getInfo() {
		return info;
	}

	/**
	 *
	 */
	public void setInfo(String value) {
		this.info = value;
	}

	public String getTenantID() {
		return tenantID;
	}

	public void setTenantID(String tenantID) {
		this.tenantID = tenantID;
	}

	public String getTenantName() {
		return tenantName;
	}

	public void setTenantName(String tenantName) {
		this.tenantName = tenantName;
	}

	public String getStateName() {
		return stateName;
	}

	public void setStateName(String stateName) {
		this.stateName = stateName;
	}

	public String getPermissionName() {
		return permissionName;
	}

	public void setPermissionName(String permissionName) {
		this.permissionName = permissionName;
	}

	public String getSrcName() {
		return srcName;
	}

	public void setSrcName(String srcName) {
		this.srcName = srcName;
	}

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Transient
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getServerType() {
		return serverType;
	}

	public void setServerType(String serverType) {
		this.serverType = serverType;
	}

	@Transient
	public String getServerTypeName() {
		return serverTypeName;
	}

	public void setServerTypeName(String serverTypeName) {
		this.serverTypeName = serverTypeName;
	}

	public Set<ServiceSchemeEntity> getServiceSchemes() {
		return serviceSchemes;
	}

	public void setServiceSchemes(Set<ServiceSchemeEntity> serviceSchemes) {
		this.serviceSchemes = serviceSchemes;
	}

	public Integer getCurSchedule() {
		return curSchedule;
	}

	public void setCurSchedule(Integer curSchedule) {
		this.curSchedule = curSchedule;
	}

	public Integer getAllSchedule() {
		return allSchedule;
	}

	public void setAllSchedule(Integer allSchedule) {
		this.allSchedule = allSchedule;
	}

	public Integer getCurLevel() {
		return curLevel;
	}

	public void setCurLevel(Integer curLevel) {
		this.curLevel = curLevel;
	}

	public String getSpend() {
		return spend;
	}

	public void setSpend(String spend) {
		this.spend = spend;
	}

	public String getMetedata() {
		return metedata;
	}

	public void setMetedata(String metedata) {
		this.metedata = metedata;
	}

	@Override
	public String getShareTenantID() {
		return shareTenantID;
	}

	@Override
	public void setShareTenantID(String shareTenantID) {
		this.shareTenantID = shareTenantID;
	}

	public String getShareTenantName() {
		return shareTenantName;
	}

	public void setShareTenantName(String shareTenantName) {
		this.shareTenantName = shareTenantName;
	}
}
